package com.sservice.urp.dao;

import com.sservice.urp.entity.User;
import com.sservice.urp.vo.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IUserDao {

    /**
     * 根据手机号查询用户对象
     *
     * @param userPhone
     * @return
     */
    User queryByPhone(String userPhone);

    /***
     * 根据用户名或手机号获取用户
     * @param user
     * @return
     */
    UserVo queryUserByPhoneOrUserName(User user);


    /**
     * 根据偏移量查询用户列表
     *
     * @param offset
     * @param limit
     * @return
     */
    List<User> queryAll(@Param("offset") int offset, @Param("limit") int limit);

    List<User> queryByPage(UserVo user);

    List<User> queryAll1(UserVo user);

    /**
     * 符合统计条件的总数统计
     *
     * @param user
     * @return
     */
    int queryCount(UserVo user);

    int queryCountByComId(UserVo user);

    int queryCountByDepId(UserVo user);


    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    /**
     * 通过用户ID 获取部门fax as dep_name,tel as com_name
     *
     * @param record
     * @return
     */
    User selectDepByPrimaryKey(User record);

    /**
     * 根据权限货权用户ID
     *
     * @param permissionId
     * @return
     */
    List<Integer> queryUserIdByPermission(String permissionId);


}
